#pragma once

#include <string>
#include "json_serialize.h"
#include "rapidjson/prettywriter.h"
#include "rapidjson/rapidjson.h"
#include "rapidjson/document.h"
#include "rapidjson/stringbuffer.h"
#include "rapidjson/writer.h"
#include "rapidjson/memorystream.h"
#include "include/rapidjson/writer.h"
#include "include/rapidjson/stringbuffer.h"
#include <iostream>

using namespace std;
using namespace rapidjson;

class Student : public JsonSerialize {
    public:
        Student() = default;
        ~Student() = default;


        virtual void ParseToJson(Writer<StringBuffer> &writer) {
            writer.StartObject();               // Between StartObject()/EndObject(), 
            writer.Key("name");                // output a key,
            writer.String(name.c_str());             // follow by a value.
            writer.Key("intNo");
            writer.Int(intNo);
            writer.Key("longNo");
            writer.Int64(longNo);
            writer.EndObject();
        };

        Student(string _name, int _intNo, long _longNo): name(_name), intNo(_intNo), longNo(_longNo){}
    private:
        string name;
        int intNo;
        long longNo;
};